<?php defined('IN_YuLin') || exit('NO PERMIT!'); ?>
{template header}
    <div id="app">
       	<header class="top">
        	<span>绑定银行卡</span> 
        	<a href="{U('member/bankcard')}" class="iconfont back"></a> 
       	</header> 
       	<div data-v-6cb1ea77="" class="main" s="[object Object]">
       		<form action="{U('member/bindcard')}" method="post" id="bindCardForm">
       			{if $bindInfo}
       				<input type="hidden" name="operation" value="edit"/>
       				<input type="hidden" name="id" value="{$bindInfo['id']}"/>
       			{else}
           			<input type="hidden" name="operation" value="add"/>
           		{/if}
                <table data-v-6cb1ea77="">
                 	<tbody data-v-6cb1ea77="">
                      	<tr data-v-6cb1ea77="" style="height: 45px; line-height: 45px; font-size: 16px;">
                           	<td data-v-6cb1ea77="">选择银行</td> 
                           	<td data-v-6cb1ea77="">
                           		<select data-v-6cb1ea77="" tag="银行" class="va23" name="bank" id="bank">
                           			<option data-v-6cb1ea77="" value="">请选择银行</option> 
                           			{loop $bankCateIdKey as $bk => $bv}
                           				<option data-v-6cb1ea77="" value="{$bv['id']}" {if $bindInfo['bank'] == $bv['id']} selected="selected" {/if}>{$bv['name']}</option> 
                           			{/loop}
                               	</select> 
                               	<i data-v-6cb1ea77="" class="iconfont unfold"></i>
                           	</td>
                      	</tr> 
                      	<tr data-v-6cb1ea77="" style="height: 45px; line-height: 45px; font-size: 16px;">
                           	<td data-v-6cb1ea77="">开户省</td> 
                           	<td data-v-6cb1ea77="">
                           		<input data-v-6cb1ea77="" type="text" tag="开户省" value="{$bindInfo['province']}" placeholder="请输入开户省" class="va23" name="province" id="province"/>
                           	</td>
                      	</tr> 
                      	<tr data-v-6cb1ea77="" style="height: 45px; line-height: 45px; font-size: 16px;">
                           	<td data-v-6cb1ea77="">开户市</td> 
                           	<td data-v-6cb1ea77="">
                           		<input data-v-6cb1ea77="" type="text" tag="开户城市" value="{$bindInfo['city']}" placeholder="请输入开户城市" class="va23" name="city" id="city"/>
                           	</td>
                      	</tr> 
                      	<tr data-v-6cb1ea77="" style="height: 45px; line-height: 45px; font-size: 16px;">
                           	<td data-v-6cb1ea77="">开户人姓名</td> 
                           	<td data-v-6cb1ea77=""><input data-v-6cb1ea77="" type="text" tag="开户人姓名" value="{$bindInfo['truename']}" placeholder="请输入银行卡的姓名" class="va23" id="truename" name="truename" /></td>
                      	</tr> 
                      	<tr data-v-6cb1ea77="" style="height: 45px; line-height: 45px; font-size: 16px;">
                           	<td data-v-6cb1ea77="">银行卡号</td> 
                           	<td data-v-6cb1ea77=""><input data-v-6cb1ea77="" type="tel" tag="银行卡号" value="{$bindInfo['bankcard']}" placeholder="请输入银行卡的卡号" class="va23" id="bankcard" name="bankcard" /></td>
                      	</tr> 
                      	<tr data-v-6cb1ea77="" style="height: 45px; line-height: 45px; font-size: 16px;">
                           	<td data-v-6cb1ea77="">确认卡号</td> 
                           	<td data-v-6cb1ea77=""><input data-v-6cb1ea77="" type="tel" tag="确认卡号" value="" placeholder="请再次输入银行卡号" class="va23" id="checkbankcard" name="checkbankcard" /></td>
                      	</tr> 
                      	<tr data-v-6cb1ea77="" style="height: 45px; line-height: 45px; font-size: 16px;">
                           	<td data-v-6cb1ea77="">安全密码</td> 
                           	<td data-v-6cb1ea77="">
                            	<form data-v-6cb1ea77="" action="" autocomplete="off">
                             		<input data-v-6cb1ea77="" type="password" tag="安全密码" placeholder="请输入您的安全密码" class="va23" name="safepwd" id="safepwd" />
                            	</form>
                        	</td>
                      	</tr> 
                      	{if $error}
                      		<tr data-v-6cb1ea77="" style="height: 45px; line-height: 45px; font-size: 16px;">
                               	<td data-v-6cb1ea77="" colspan="2">
                               		<font style="font-size: 12px; color: red; padding-left: 20px;">{$error}</font>
                               	</td> 
                          	</tr> 
                      	{/if}
                      	<tr data-v-6cb1ea77=""></tr>
                 	</tbody>
                </table> 
            </form>
            <div data-v-6cb1ea77="" class="loginBtn BTN">
             	<a data-v-6cb1ea77="" class="tag_bindcard">确定</a>
            </div>
       	</div> 
    </div>
    <script>
    	$('.tag_bindcard').on('click', '', function (){
    		if(!$('#bank').val()){
    			layer.alert('请选择银行');
    			return;
    		}
    		if(!$('#province').val()){
    			layer.alert('请输入开户省');
    			return;
    		}
    		if(!$('#city').val()){
    			layer.alert('请输入开户城市');
    			return;
    		}
    		if(!$('#truename').val()){
    			layer.alert('请填写开户人');
    			return;
    		}
    		if(!$('#bankcard').val()){
    			layer.alert('请输入卡号');
    			return;
    		}
    		if(!$('#checkbankcard').val()){
    			layer.alert('请确认银行卡号');
    			return;
    		}
    		if($('#bankcard').val() != $('#checkbankcard').val()){
    			layer.alert('两次卡号不一致');
    			return;
    		}
    		if(!$('#safepwd').val()){
    			layer.alert('请输入安全码');
    			return;
    		}
    		$('#bindCardForm').submit();
    	})
    </script>
    {template footer}
</html>